import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { ExamComponent } from './exam.component';
import { QuestionComponent } from './question/question.component';
import { ImportQuestionComponent } from './importquestion/import-question.component';
import { PaperComponent } from './paper/paper.component';
import { DoexamComponent } from './doexam/doexam.component';
import { AchievementComponent } from './achievement/achievement.component';
import { StatisticsComponent } from './statistics/statistics.component';
import { QbankComponent } from './qbank/qbank.component';

const routes: Routes = [{
  path: '',
  component: ExamComponent,
  children: [{
    path: 'question',
    component: QuestionComponent,
  },
  {
    path: 'importquestion',
    component: ImportQuestionComponent,
  },
  {
    path: 'paper',
    component: PaperComponent,
  },
  {
    path: 'achievement',
    component: AchievementComponent,
  },
  {
    path: 'statistics',
    component: StatisticsComponent,
  },
  {
    path: 'doexam/:paperId',
    component: DoexamComponent,
  },
  {
    path: 'qbank',
    component: QbankComponent,
  },
  ],
}];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class ExamRoutingModule { }

export const routedComponents = [
  ExamComponent,
  QuestionComponent,
  PaperComponent,
  DoexamComponent,
  ImportQuestionComponent,
  AchievementComponent,
  StatisticsComponent,
  QbankComponent,
];
